package com.csqf.booksys.entity;

import java.util.List;

/**
 * 设计分页JavaBean
 * @author enbo.xie
 * @Date 2020年8月27日 上午9:29:49
 */
public class PageBean<T> {
	private int currentPage = 1;//当前页数
	private int pageSize = 3;//没页显示的数据条数
	private int totalNum;//总条数
	private int totalPage;//总页数
	private List<T> dataList;//每次查询数据的集合
	/**
	 * @return the currentPage
	 */
	public int getCurrentPage() {
		return currentPage;
	}
	/**
	 * @param currentPage the currentPage to set
	 */
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	/**
	 * @return the pageSize
	 */
	public int getPageSize() {
		return pageSize;
	}
	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	/**
	 * @return the totalNum
	 */
	public int getTotalNum() {
		return totalNum;
	}
	/**
	 * @param totalNum the totalNum to set
	 */
	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
	}
	/**
	 * @return the totalPage
	 */
	public int getTotalPage() {
		//获取总条数
		if(this.getTotalNum()%this.getPageSize() == 0){
			totalPage = this.getTotalNum()/this.getPageSize();
		}else{
			totalPage = this.getTotalNum()/this.getPageSize() + 1;
		}
		return totalPage;
	}
	/**
	 * @param totalPage the totalPage to set
	 */
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	/**
	 * @return the dataList
	 */
	public List<T> getDataList() {
		return dataList;
	}
	/**
	 * @param dataList the dataList to set
	 */
	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}
}
